<template>
  <div class="topNav">
    <!-- 左边 -->
    <!-- 使用 svg 图标 -->
    <div class="icon topLeft">
      <img src="@/assets/img/首页.svg" alt="" @click="tuichu" />
    </div>

    <!-- 中间 -->
    <div class="topContent">
      <span @click="$router.push('/infoUser')">我的</span>
      <span class="active">发现</span>
      <span>云村</span>
      <span>视频</span>
    </div>

    <!-- 右边 -->
    <div class="icon topRight">
      <img src="@/assets/img/搜索.svg" alt="" @click="$router.push('/search')" />
    </div>
  </div>
</template>

<script>
export default {
  methods: {
    tuichu() {
      // 清空 token ,跳转到 login 页面
      window.sessionStorage.clear('token')
      this.$router.push('/login')
    },
  },
}
</script>

<style lang="less" scoped>
.icon {
  width: 0.5rem;
  height: 0.5rem;
}
.topNav {
  width: 100%;
  height: 1rem;
  padding: 0.2rem;
  /* 弹性布局 */
  display: flex;
  /* 水平对齐 */
  justify-content: space-between;
  // 垂直居中
  align-content: space-between;
  .topContent {
    width: 65%;
    height: 100%;
    display: flex;
    justify-content: space-around;
    font-size: 0.36rem;
    .active {
      font-weight: 900;
    }
  }
}
</style>
